﻿Imports MySql.Data.MySqlClient

Public Class DataAccess

    Shared mServer As String = "mysql.crc3.info"
    Shared mUser As String = "crc_soft"
    Shared mPwd As String = "pro25:9"
    Shared mDB As String = "crc_soft"

    Shared Function Get_Data(ByVal sql As String) As DataSet
        Try
            Dim ConectString As String = "server=" + mServer + ";uid=" + mUser + ";pwd=" + mPwd + ";database=" + mDB + ";"
            Dim conn As MySqlConnection = New MySql.Data.MySqlClient.MySqlConnection(ConectString)
            Dim comand As New MySqlCommand(sql, conn)
            Dim adapter As New MySqlDataAdapter(comand)
            Dim ds As New DataSet
            adapter.Fill(ds)
            Return ds
        Catch ex As Exception
            Return Nothing
        End Try
    End Function
End Class
